View Javadoc

1   /*
2    * Created on 13.03.2004
3    *
4    * To change the template for this generated file go to
5    * Window>Preferences>Java>Code Generation>Code and Comments
6    */
7   package ch.twiddlefinger.inet.rewinder.model.replay.structs;
8   
9   import ch.twiddlefinger.inet.rewinder.model.entities.Race;
10  
11  
12  /***
13   * @author matthias.vonrohr
14   *
15   * To change the template for this generated type comment go to
16   * Window>Preferences>Java>Code Generation>Code and Comments
17   */
18  public class PlayerInfoRecord extends WarcraftHeader {
19      public final Unsigned32 runtime = new Unsigned32();
20      public final Unsigned32 race = new Unsigned32();
21  
22      public PlayerInfoRecord(byte[] b) {
23          super(b);
24      }
25  
26      public static Race getRace(int k) {
27          switch (k) {
28          case 0x01:
29              return Race.HUMAN;
30  
31          case 0x02:
32              return Race.ORC;
33  
34          case 0x04:
35              return Race.NIGHTELF;
36  
37          case 0x08:
38              return Race.UNDEAD;
39              
40          case 0x20:
41              return Race.RANDOM;
42  
43          default:
44              return Race.UNKNOWN;
45          }
46      }
47  
48      public Race getRace() {
49          return getRace((int) this.race.get());
50      }
51  }